home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 19
/
CD_ASCQ_19_010295.iso
/
dos
/
prg
/
pas
/
swag
/
egavga.swg
/
0007_Text fading on a VGA.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-05-28
|
765b
|
41 lines
{
Here is some code to try For Text fading on a vga...
by Sean Palmer
}
Const
tableReadIndex = $3C7;
tableWriteIndex = $3C8;
tableDataRegister = $3C9;
Procedure setColor(color, r, g, b : Byte); Assembler;
Asm {set DAC color}
mov dx, tableWriteIndex;
mov al, color;
out dx, al;
inc dx;
mov al, r;
out dx, al;
mov al, g;
out dx, al;
mov al, b;
out dx, al;
end; {Write index now points to next color}
Function getColor(color : Byte) : LongInt; Assembler;
Asm {get DAC color}
mov dx, tableReadIndex;
mov al, color;
out dx, al;
add dx, 2;
cld;
xor bh, bh;
in al, dx;
mov bl, al;
in al, dx;
mov ah, al;
in al, dx;
mov dx, bx;
end; {read index now points to next color}